<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="inp" list="cars"/>
<datalist id="cars">
    <option value="BMW">
    <option value="Ford">
    <option value="Volvo">
</datalist>
<button onclick="autoFocus()">1</button>
</body>
<script>
    function autoFocus() {
        var pFocus=document.getElementById('inp');
        pFocus.focus()
        console.log(pFocus)
    }
</script>
</html>
